#include "Run.cpp"


void clean_outfile(char* workdir) {
    int pid = fork();
    if (pid == 0) {
        execl("/bin/rm", "rm", "*", NULL);
    }
    else {
        wait(NULL);
    }
}
int main(int argc, char** argv) {
    double time, mem;
    int res = run(CPP, argv[1], 1, 256, time, mem);
    printf("%d", res);
    if (res == OJ_OK) {
        std::string str = (std::string)argv[1] + "/user.out";
        FILE* file = fopen(str.c_str(), "a+");
        sprintf(buf, "\n\ntime: %fms\n", time);
        fputs(buf, file);
        sprintf(buf, "memery: %fM\n", mem);
        fputs(buf, file);
        fclose(file);
    }
    return 0;
}
